home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / userbox / publicdomain / vim-4.2 / src / gui_at_sb.h < prev    next >
C/C++ Source or Header  |  1996-06-09  |  6KB  |  163 lines

  1. /* vi:set ts=8 sw=4: */
  2. /* MODIFIED ATHENA SCROLLBAR (USING ARROWHEADS AT ENDS OF TRAVEL) */
  3. /* Modifications Copyright 1992 by Mitch Trachtenberg             */
  4. /* Rights, permissions, and disclaimer of warranty are as in the  */
  5. /* DEC and MIT notice below.  See usage warning in .c file.       */
  6. /*
  7.  * $XConsortium: ScrollbarP.h,v 1.3 94/04/17 20:12:42 jim Exp $
  8.  */
  9.  
  10.  
  11. /***********************************************************
  12.  
  13. Copyright (c) 1987, 1988  X Consortium
  14.  
  15. Permission is hereby granted, free of charge, to any person obtaining a copy
  16. of this software and associated documentation files (the "Software"), to deal
  17. in the Software without restriction, including without limitation the rights
  18. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19. copies of the Software, and to permit persons to whom the Software is
  20. furnished to do so, subject to the following conditions:
  21.  
  22. The above copyright notice and this permission notice shall be included in
  23. all copies or substantial portions of the Software.
  24.  
  25. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  26. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  27. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  28. X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  29. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  30. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  31.  
  32. Except as contained in this notice, the name of the X Consortium shall not be
  33. used in advertising or otherwise to promote the sale, use or other dealings
  34. in this Software without prior written authorization from the X Consortium.
  35.  
  36.  
  37. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
  38.  
  39.                         All Rights Reserved
  40.  
  41. Permission to use, copy, modify, and distribute this software and its 
  42. documentation for any purpose and without fee is hereby granted, 
  43. provided that the above copyright notice appear in all copies and that
  44. both that copyright notice and this permission notice appear in 
  45. supporting documentation, and that the name of Digital not be
  46. used in advertising or publicity pertaining to distribution of the
  47. software without specific, written prior permission.  
  48.  
  49. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  50. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  51. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  52. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  53. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  54. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  55. SOFTWARE.
  56.  
  57. ******************************************************************/
  58.  
  59. #ifndef _Scrollbar_h
  60. #define _Scrollbar_h
  61.  
  62. /****************************************************************
  63.  *
  64.  * Scrollbar Widget
  65.  *
  66.  ****************************************************************/
  67.  
  68. #include <X11/IntrinsicP.h>
  69. #include <X11/Xaw/SimpleP.h>
  70. #include <X11/Xmu/Converters.h>
  71.  
  72. /* 
  73.  * Most things we need are in StringDefs.h 
  74.  */
  75. #define XtCMinimumThumb        "MinimumThumb"
  76. #define XtCShown        "Shown"
  77. #define XtCTopOfThumb        "TopOfThumb"
  78. #define XtCMaxOfThumb        "MaxOfThumb"
  79. #define XtCShadowWidth        "ShadowWidth"
  80. #define XtCTopShadowPixel    "TopShadowPixel"
  81. #define XtCBottomShadowPixel    "BottomShadowPixel"
  82.  
  83. #define XtNminimumThumb        "minimumThumb"
  84. #define XtNtopOfThumb        "topOfThumb"
  85. #define XtNmaxOfThumb        "maxOfThumb"
  86. #define XtNshadowWidth        "shadowWidth"
  87. #define XtNtopShadowPixel    "topShadowPixel"
  88. #define XtNbottomShadowPixel    "bottomShadowPixel"
  89.  
  90. typedef struct _ScrollbarRec      *ScrollbarWidget;
  91. typedef struct _ScrollbarClassRec *ScrollbarWidgetClass;
  92.  
  93. extern WidgetClass vim_scrollbarWidgetClass;
  94.  
  95. #if NeedWidePrototypes
  96. extern void vim_XawScrollbarSetThumb __ARGS((Widget, double, double, double));
  97. #else
  98. extern void vim_XawScrollbarSetThumb __ARGS((Widget, float, float, float));
  99. #endif
  100.  
  101. typedef struct
  102. {
  103.      /* public */
  104.     Pixel      foreground;    /* thumb foreground color */
  105.     XtOrientation orientation;    /* horizontal or vertical */
  106.     XtCallbackList scrollProc;    /* proportional scroll */
  107.     XtCallbackList thumbProc;    /* jump (to position) scroll */
  108.     XtCallbackList jumpProc;    /* same as thumbProc but pass data by ref */
  109.     Pixmap      thumb;    /* thumb color */
  110.     float      top;        /* What percent is above the win's top */
  111.     float      shown;    /* What percent is shown in the win */
  112.     float      max;        /* Maximum value for top */
  113.     Dimension      length;    /* either height or width */
  114.     Dimension      thickness;    /* either width or height */
  115.     Dimension      min_thumb;    /* minium size for the thumb. */
  116.  
  117.      /* private */
  118.     XtIntervalId  timer_id;     /* autorepeat timer; remove on destruction */
  119.     char      scroll_mode;    /* see below */
  120.     float      scroll_off;    /* offset from event to top of thumb */
  121.     GC          gc;        /* a (shared) gc */
  122.     Position      topLoc;    /* Pixel that corresponds to top */
  123.     Dimension      shownLength;    /* Num pixels corresponding to shown */
  124.  
  125.     /* From 3d widget */
  126.     Dimension    shadow_width;
  127.     Pixel    top_shadow_pixel;
  128.     Pixel    bot_shadow_pixel;
  129.     int        top_shadow_contrast;
  130.     int        bot_shadow_contrast;
  131.     GC        top_shadow_GC;
  132.     GC        bot_shadow_GC;
  133. } ScrollbarPart;
  134.  
  135. #define SMODE_NONE        0
  136. #define SMODE_CONT        1
  137. #define SMODE_PAGE_UP        2
  138. #define SMODE_PAGE_DOWN        3
  139. #define SMODE_LINE_UP        4
  140. #define SMODE_LINE_DOWN        5
  141.  
  142. #define ONE_LINE_DATA        1
  143. #define ONE_PAGE_DATA        10
  144. #define END_PAGE_DATA        9999
  145.  
  146. typedef struct _ScrollbarRec {
  147.     CorePart        core;
  148.     SimplePart        simple;
  149.     ScrollbarPart    scrollbar;
  150. } ScrollbarRec;
  151.  
  152. typedef struct {int empty;} ScrollbarClassPart;
  153.  
  154. typedef struct _ScrollbarClassRec {
  155.     CoreClassPart        core_class;
  156.     SimpleClassPart        simple_class;
  157.     ScrollbarClassPart        scrollbar_class;
  158. } ScrollbarClassRec;
  159.  
  160. extern ScrollbarClassRec vim_scrollbarClassRec;
  161.  
  162. #endif /* _Scrollbar_h */
  163.